﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.MenuCommand;
using RBAC.MaHaiBo.Entity;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.MenuHandler
{
    public class MenuBackfillCommandHandler:IRequestHandler<MenuBackfillCommand,Menu>
    {
        /// <summary>
        /// 菜单服务层接口
        /// </summary>
        IMenuService mSer;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="urSer"></param>
        public MenuBackfillCommandHandler(IMenuService mSer)
        {
            this.mSer = mSer;
        }

        public async Task<Menu> Handle(MenuBackfillCommand request, CancellationToken cancellationToken)
        {
            return await mSer.GetMenuInfo(request.Mid);
        }
    }
}
